from sbprice import *

s = Solution(0, 0)


def buy(price, size):
    s.buy(SB(price, size, 0, 0, True))


def sell(price, size):
    s.sell(SB(price, size, 0, 0, False))


def t(size, buy_price, sell_price):
    buy(buy_price, size)
    sell(sell_price, size)


def g(number, buy_price, sell_price):
    t(number, buy_price, sell_price)


# def t20241220():
#     g(700, 6.72, 6.68)
#     g(700, 6.72, 6.68)
#     g(1500, 6.71, 6.68)
#     g(1500, 6.61, 6.72)
#     g(1500, 6.60, 6.75)
#     print("结算261.88,计算261.32")


def go():
    # a = 430000 + (520000 + 50000) + 30000
    # b = 18600 + 1200 + 800
    # # c = 35.70  # 36.76
    # print(
    #     f"""
    #     现值{c}
    #     平均{round(a / b,2)}
    #     偏离{round(c - a / b ,2)} , {round(round(c - a / b ,2) * b,2)}
    #     偏离{round((a / b - c) / (a / b) * 100, 2)}%
    #     修正{round((a / b - c) / c * 100 , 2)}%"""
    # )

    # t20241220()
    # g(69200, 6.65, 6.67)
    # t(400, 6.22, 6.25)
    # g(500, 6.22, 6.25)
    # g(900, 6.22, 6.25)
    # g(900, 6.21, 6.25)
    # g(1800, 6.20, 6.25)
    # g(3000, 6.19, 6.25)
    # g(3000, 6.18, 6.25)
    # t(1600, 45.62, 45.74)
    # t(100, 45.69, 45.74)
    # t(1600, 45.61, 45.74)
    # t(1600, 46.08, 46.17)
    # t(1600, 45.94, 46.13)
    # t(200, 40.70, 42.04)
    # t(6500, 42.42, 42.5)
    # t(3300, 42.42, 42.74)
    # t(3300, 42.42, 43.01)
    s.show()
    print("%31.2f" % s.tot)


go()

# print((11900 * 49.01))
# print(11900 * 1.5)
# print(586000 / 11900)
print(61.6 / 1.32)
print(13200 * 1.5)


print((11038.9 - 10850.72))
print(2584 - 2390)
